#include <cstdio>
#include <random>
#include "head_file.cpp"
void reverse_arr_by_arr(int arr[], int len) {
  int l = 0;
  int r = len - 1;
  int temp;
  while (l < r) {
    temp = arr[r];
    arr[r] = arr[l];
    arr[l] = temp;
    l++;
    r--;
  }
  print_arr(arr, len);
}
void reverse_arr_by_pointer(int *p, int len) {
  int l = 0;
  int r = len - 1;
  int temp;
  while (l < r) {
    temp = *(p+r);
    *(p+r) = *(p+l);
    *(p+l) = temp;
    l++;
    r--;
  }

}
int main() {
  int arr[] = {1, 2, 3, 4, 5, 6, 7, 8};
  int len = sizeof(arr) / sizeof(arr[0]);
  reverse_arr_by_arr(arr, len);
  reverse_arr_by_pointer(arr, len);
  print_arr(arr, len);
}


